package com.od.service.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.od.entity.City;
import com.od.mapper.CityMapper;
import com.od.mapper.ProvinceCityMapper;
import com.od.service.CityService;
import com.od.utils.ProvinceCity;

@Service
public class CityServiceImpl implements CityService {
    @Autowired
    private CityMapper cityMapper;

    @Autowired
    private ProvinceCityMapper provinceCityMapper;

    @Override
    public List<City> getAllCities() {
        return cityMapper.selectAllCities();
    }

    @Override
    public List<ProvinceCity> getProvinceCity() {
        return provinceCityMapper.selectAllProvinces();
    }

    @Override
    public String getCityNameById(int cityId) {
        return cityMapper.selectCityNameById(cityId);
    }

}
